#include "ChatGrpcClient.h"
#include "RedisMgr.h"



ChatGrpcClient::ChatGrpcClient() {
	auto& cfg = ConfigMgr::GetInstance();
	std::string server_list = cfg["chatservers"]["Name"];

	std::stringstream ss(server_list);
	std::string word;
	std::vector<std::string> words;


	while(std::getline(ss,word,','))
	{
		words.push_back(word);

		if (cfg[word]["Name"].empty())
		{
			continue;
		}
		_pools[word] = std::make_unique<ChatConPool>(5, cfg[word]["Host"], cfg[word]["Port"]);
	}

	
}

AddFriendRsp ChatGrpcClient::NotifyAddFriend(const AddFriendReq& req)
{
	auto to_uid = req.touid();
	std::string  uid_str = std::to_string(to_uid);

	AddFriendRsp rsp;
	return rsp;
}

